<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <script type="text/javascript" src="../internal.js"></script>
    <style type="text/css">
        *{margin:0;padding:0;color: #838383;}
        table{font-size: 12px;margin: 10px;line-height: 30px}
        .txt{width:300px;height:21px;line-height:21px;border:1px solid #d7d7d7;}
    </style>
</head>
<body>

    <table>
        <tr>
            <td><label for="href">音频地址：</label></td>
            <td><input class="txt" id="href" type="text" style="width:225px;"/></td>
        </tr>    
    </table>
<script type="text/javascript">
    function handleDialogOk() {
        if ($G('href').value) {
            var patt1 = /ogg|oga|aac|m4a|mp3|wav/gi;

            if (patt1.test($G('href').value)) {
                editor.execCommand('insertHtml', "<object>"+
							                		"<embed class='edui-faked-music' pluginspage='http://www.macromedia.com/go/getflashplayer' "+
							                		" src='"+$G('href').value+"' width='400' height='95' wmode='transparent' play='true' "+
							                		" loop='false' menu='false' allowscriptaccess='never' allowfullscreen='true'/>"
							                    + "</object>");
                dialog.close();

            } else {
                alert("不支持该音频格式");
                return false;
            }

        } else {
            alert("请输入音频地址");
            return false;
        }
    }
    dialog.onok = handleDialogOk;
    $G('href').onkeydown = function(evt) {
        evt = evt || window.event;
        if (evt.keyCode == 13) {
            handleDialogOk();
            return false;
        }
    }
</script>
</body>
</html>